<!-- add by lty 20181222 -->

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>租客保洁查询</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/reportList.css">

    <script src="js/jquery/3.2.1/jquery.min.js"></script>
    <!-- 插件js -->
	<script src="../js/zepto.js"></script>
	<script src="../js/sm.js" ></script>
	<script src="../js/sm-extend.js" ></script>
	<script src="../js/request.js"></script>
	<script src="../../js/common.js"></script>
    <script type="text/javascript">
	window.$$=window.Zepto = Zepto;
	</script>
  </head>
  <body>
    <div class="page">
      <header class="bar bar-nav">
        <a class="button button-link button-nav pull-left" href="javascript:window.history.back();" data-transition='slide-out'>
          <span class="icon icon-left"></span>
          返回
        </a>
        <h1 class="title">服务查询</h1>
        <div class="nav_select--more cl">
          <span class="fl">全部</span>
          <i class="icon icon-down fl"></i>
        </div>
        
        <!-- 更多时间选择 -->
        <ol class="nav_ol--time">
          <span class="ol_jiao"></span>
          <li value=""><a href="javascript:void(0);">全部</a></li>
          <li value="1"><a href="javascript:void(0);">日常保洁</a></li>
          <li value="2"><a href="javascript:void(0);">深度保洁</a></li>
        </ol>
      </header>

      <!-- 列表 -->
      <div class="L_content">
        <div class="L_content--report_block">
          <ul class="packageList">
            <!-- <li class="report_block--li cl">
              <div class="report_block--li_img fl">
                <img src="images/reportList/i-f7.png" alt="">
              </div>
              <div class="report_block--li_inner fr">
                <div class="report_block--inner_inline">
                  <span class="li_inner--span01">深度保洁套餐 ></span>
                  <span class="li_inner--span02 fr">已完成/等待服务</span>
                </div>
                <div class="report_block--inner_inline">
                  <span class="li_inner--span01">日常保洁套餐 ></span>
                  <span class="li_inner--span02 fr">4次</span>
                </div>
                <div class="report_block--inner_comment cl">
                  <div class="comment--text fl">
                    综合评价：
                    <div class="inner_comment--star">
                      <i class="icon icon-star"></i>
                      <i class="icon icon-star"></i>
                      <i class="icon icon-star"></i>
                      <i class="icon icon-star"></i>
                      <i class="icon icon-star"></i>
                    </div>
                  </div>
                  <a href="cleanDetail.html" class="to_comment--detail fr">查看详情</a>
                </div>
              </div>
            </li>
            
            <li class="report_block--li cl">
              <div class="report_block--li_img fl">
                <img src="images/reportList/i-f7.png" alt="">
              </div>
              <div class="report_block--li_inner fr">
                <div class="report_block--inner_inline">
                  <span class="li_inner--span01">深度保洁套餐 ></span>
                  <span class="li_inner--span02 fr">1次</span>
                </div>
                <div class="report_block--inner_inline">
                  <span class="li_inner--span01">日常保洁套餐 ></span>
                  <span class="li_inner--span02 fr">4次</span>
                </div>
                <div class="report_block--inner_comment cl">
                  <div class="comment--text fl">
                    未评论
                  </div>
                  <a href="" class="to_comment--detail fr">查看详情</a>
                </div>
              </div>
            </li> -->
          </ul>
        </div>
      </div>
    </div>
    <!--  <div style="text-align: center;margin-top: -16%">
			<div class="weui-loadmore" style="display: none" id="loadmore">
	            <i class="weui-loading"></i>
	            <span class="weui-loadmore__tips">正在加载</span>
      		 </div>
      		 <p class="page__desc"  onclick="more()">加载更多</p>
		</div> -->
    <script type="text/javascript">
    var path = "/LanJuPublic";
    var offset = 0;//起始页码
	var limit =10;//每页个数
	var serviceType = 1;
	var chargesType = "";
	var statusArr = {
			"0":"待接单",
			"1":"等待服务",
			"2":"服务中",
			"3":"服务完成",
	}
	
	$(function(){
		loadList();
		// 选择类型
		  $(".nav_select--more").click(function(){
		    $('.nav_ol--time').toggleClass('ol_show');
		  });
		
		$('.nav_ol--time a').click(function(){
			chargesType = $(this).parent().attr("value");
			loadList();
			$('.nav_ol--time').toggleClass('ol_show');
		  });
	})
	function add0(m){return m<10?'0'+m:m }
	function getLocalTime(shijianchuo) {     
		//shijianchuo是整数，否则要parseInt转换
		var time = new Date(shijianchuo);
		var y = time.getFullYear();
		var m = time.getMonth()+1;
		var d = time.getDate();
		var h = time.getHours();
		var mm = time.getMinutes();
		var s = time.getSeconds();
		return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
    }     
	
	function loadList(){
	$$.showPreloader("加载中");
	$.ajax({
		url : path+"/service/queryPackageList.do",
		data : {
			"offset": offset,
			"limit": limit,
			"serviceType":serviceType,
			"chargesType":chargesType
		},
		type : "GET",
		dataType : 'json',
		cache : false,
		success : function(ret){
			$$.hidePreloader();
			var html = '';
			if(ret.rows && ret.rows.length>0){
				$.each(ret.rows,function(i,n){
					html+='<li class="report_block--li cl">';
					html+=  '<div class="report_block--li_img fl">';
					html+=' <img src="'+n.imgUrl+'" alt="">';
					html+='</div>';
					html+='<div class="report_block--li_inner fr">';
					html+='  <div class="report_block--inner_inline">';
					html+='    <span class="li_inner--span01">'+n.serviceName+'</span>';
					html+='    <span class="li_inner--span02 fr">'+statusArr[n.status]+'</span>';
					html+='  </div>';
					html+='  <div class="report_block--inner_inline">';
					html+='    <span class="li_inner--span01">'+getLocalTime(n.createTime)+'</span>';
					html+='    <span class="li_inner--span02 fr">共'+n.serviceCount+'次/剩'+(n.goodStar==null?0:n.goodStar)+'次</span>';
					html+=' </div>';
					html+=' <div class="report_block--inner_comment cl">';
					if(n.goodStar!=null){
						html+=' <div class="comment--text fl">';
						html+=' 综合评价：';
						html+=' <div class="inner_comment--star">';
						for(var i=0;i<n.goodStar;i++){
							html+='<i class="icon icon-star-full"></i>';
						}
						html+=' </div></div>';
						
					}else{
						html+=' <div class="comment--text fl">';
						html+=' 未评价';
						html+=' </div>';
					}
					html+='<a href="cleanDetail.html" class="to_comment--detail fr">查看详情</a>';
					html+=' </div>';
	             html+=' </div>';
	             html+='  </li>';
				});
			}
			$(".packageList").html( html||'<ul><li class="report_block--li cl">暂无数据</li></ul>' );
		},
		error: function(){
			$$.hidePreloader();
			$$.toast("加载出错");
		}
	});
}
	function toLink(id) {
		window.location.href="../service/serviceDetail.html?serviceId="+id;
	}
</script>
  </body>
</html>